#!/usr/bin/env python

from page_manager_class import PageManager

def get ( liwe, id_page, page_name = '' ):
	"""
	:INPUT:

		- id_page:		SAFE_NUMBER
		- page_name:	SAFE_DB_STRING
	"""

	tp = PageManager ( liwe )
	return { 'page': tp.get ( id_page, page_name ) }

def search ( liwe, testo, module = '', fields = '' ):
	"""
	:INPUT:
		- testo:		SAFE_DB_STRING
		- module:		SAFE_DB_STRING
		- fields:	    Fields name separated by "|"   SAFE_STRING

	"""

	if fields: fields = fields.split ( "|" )

	tp = PageManager ( liwe )
	return { 'pages': tp.search ( testo, module, fields ) }
